﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace BigData.DataContracts.Objects.Reddit
{
    [DataContract]
    public class Link : UserCreatedThing
    {

        public class MediaEmbed
        {
            public string content { get; set; }
            public int width { get; set; }
            public bool scrolling { get; set; }
            public int height { get; set; }
        }

        [DataMember]
        public string   author { get; set; }	                //the account name of the poster
        [DataMember]
        public string author_flair_css_class { get; set; }	    //the css class of the author's flair. subreddit specific
        [DataMember]
        public string author_flair_text { get; set; }	        //the text of the author's flair. subreddit specific
        [DataMember]
        public bool clicked { get; set; }	                    //probably always returns false
        [DataMember]
        public string domain { get; set; }	                    //the domain of this link. Self posts will be self.reddit.com while other examples include en.wikipedia.org and s3.amazon.com
        [DataMember]
        public bool hidden { get; set; }	                    //true if the post is hidden by the logged in user. false if not logged in or not hidden.
        [DataMember]
        public bool is_self { get; set; }	                    //true if this link is a selfpost
        [DataMember]
        public object media { get; set; }	                    //unknown. I need someone else to document this as I haven't done much research into this
        [DataMember]
        public MediaEmbed media_embed { get; set; }	                //unknown. I need someone else to document this as I haven't done much research into this
        [DataMember]
        public int num_comments { get; set; }	                //the number of comments that belong to this link
        [DataMember]
        public bool over_18 { get; set; }	                    //true if the post is tagged as NSFW. False if otherwise
        [DataMember]
        public string permalink { get; set; }	                //relative url of the permanent link for this link
        [DataMember]
        public bool saved { get; set; }	                        //true if this post is saved by the logged in user
        [DataMember]
        public int score { get; set; }	                        //the net-score of the link. note: A submission's score is simply the number of upvotes minus the number of downvotes. If five users like the submission and three users don't it will have a score of 2. Please note that the vote numbers are not "real" numbers, they have been "fuzzed" to prevent spam bots etc. So taking the above example, if five users upvoted the submission, and three users downvote it, the upvote/downvote numbers may say 23 upvotes and 21 downvotes, or 12 upvotes, and 10 downvotes. The points score is correct, but the vote totals are "fuzzed".
        [DataMember]
        public string selftext { get; set; }	                //the raw text. this is the unformatted text which includes the raw markup characters such as ** for bold.
        [DataMember]
        public string selftext_html { get; set; }	            //the formatted escaped html text. this is the html formatted version of the marked up text. Items that are boldened by ** or *** will now have <em> or *** tags on them. Additionally, bullets and numbered lists will now be in html list format. NOTE: The html string will be escaped. You must unescape to get the raw html.
        [DataMember]
        public string subreddit { get; set; }	                //
        [DataMember]
        public string subreddit_id { get; set; }	            //
        [DataMember]
        public string thumbnail { get; set; }	                //full url to the thumbnail for this link
        [DataMember]
        public string title { get; set; }	                    //
        [DataMember]
        public string url { get; set; }	                        //the link of this post. the permalink if this is a self-post
    }
}
